//
//  CJCodeController.swift
//  CJPack
//
//  Created by 陈警卫 on 2024-05-21.
//

import UIKit

class CJCodeController: CJBaseBackController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        setupView()
    }
    
    var animV: UIView!
    
    
    func setupView() {
        
        let codeView = CJCodeView(frame: CGRect(x: 10, y: 120, width: view.cj_width - 20, height: 50))
        codeView.backgroundColor = UIColor.yellow
        view.addSubview(codeView)
        
        animV = UIView()
        animV.backgroundColor = .red
        view.addSubview(animV)
        
        animV.snp.makeConstraints { make in
            make.bottom.equalTo(0);
            make.left.right.equalTo(0);
            make.height.equalTo(100);
        }
    }
    
    override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
        
        UIView.animate(withDuration: 0.5) {
            self.animV.snp.updateConstraints { make in
                make.height.equalTo(500);
            }
            self.view.layoutIfNeeded()
        }
        
    }

}
